package HomeWork;

import java.util.Arrays;
import java.util.Scanner;

public class Num {
    static int a[]=new int[5];

    public void dx(){//倒叙
        for (int i = 4;i>=0 ; i--) {
            System.out.print(a[i]+",");
        }
    }
    public void px(){//排序
        Arrays.sort(a);
        for (int i = 0; i <5 ; i++) {
            System.out.print(a[i]+",");
        }
    }
    public static void main(String[] args) {
        System.out.println("请输入五个数");
        Scanner scanner=new Scanner(System.in);
        for (int i = 0; i <5 ; i++) {
            int num=scanner.nextInt();
            a[i]=num;
        }
        Num num=new Num();
        System.out.println("倒叙：");
        num.dx();
        System.out.println();
        System.out.println("排序：");
        num.px();
    }
}
